package com.record.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class IndexedValue {
    private Integer index;   // 序号
    private Integer value;   // 原值
    private Integer result;  // 计算结果 (maxIndex - index) + 2
    private String herbName;  // 药材名
    private Double herbDosage; // 剂量

    public IndexedValue(Integer index, Integer value, Integer maxIndex) {
        this.index = index;
        this.value = value;
        this.result = (maxIndex - index) + 2;
    }

    public Integer getIndex() {
        return index;
    }

    public Integer getValue() {
        return value;
    }

    public Integer getResult() {
        return result;
    }

    @Override
    public String toString() {
        return "IndexedValue{index=" + index +
                ", value=" + value +
                ", result=" + result + "}";
    }
}
